package com.wanxi.education.common;

/**
 * @Author: 寇文宝
 * @Description: 支付方式描述
 * @Date: Created in 2021/9/27
 * @Version: 1.0
 */
public enum PaymentMethodCode {

    CANCEL(0,"主动取消"),
    WX(1,"微信"),
    UNPAID(2,"暂未进行支付"),
    AUTOCANCEL(-1,"自动取消");

    private Integer code;
    private String msg;

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static String getOrderStateCodeMsg(Integer code){
        PaymentMethodCode[] orderStateCodes = values();
        for (PaymentMethodCode orderStateCode : orderStateCodes) {
            if (orderStateCode.getCode().equals(code)){
                return orderStateCode.getMsg();
            }
        }
        return null;
    }

    PaymentMethodCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
